<template>
  <view class="product-like">
    <view class="title">- 猜你喜欢 -</view>
    <list :list="like" />
  </view>
</template>

<script>
import List from '../list/index'
import base64 from '../../util/base64'
import Product from '../../api/product'
const productModel = new Product()
export default {
  components: {
    List
  },
  data() {
    return {
      like: []
    }
  },
  methods: {
    fetchData() {
      productModel.like().then(response => {
        let { data } = response
        data = base64.parse(data)
        this.like = data
        // console.log(data)
      })
    }
  },
  created() {
    this.fetchData()
  }
}
</script>

<style scoped lang="scss">
.product-like {
  margin: 0 20rpx;
  .title {
    text-align: center;
    height: 70rpx;
    line-height: 70rpx;
    padding-top: 30rpx;
    font-weight: 700;
    font-size: 32rpx;
    color: $main_color;
  }
}
</style>
